#!/usr/bin/env node
(async () => {
    const { Writable } = require('stream');
    const chalk = (await import('chalk')).default;

    class GreenStream extends Writable {
    _write(chunk, encoding, callback) {
        const greenText = chalk.greenBright(chunk.toString());
        process.stdout.write(greenText);
        callback();
    }
    }

    const greenStream = new GreenStream();
    process.stdin.pipe(greenStream);
    console.log('请输入文本，输入的文本将以亮绿色显示在控制台:');
})();

